package com.ruoyi.db.oms.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 订单列表对象 oms_order
 *
 * @author yfy
 * @date 2020-04-27
 */

@ApiModel("订单列表实体类")
@Data
@EqualsAndHashCode(callSuper=true)
public class OmsOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("订单ID")
    private Long id;

    @ApiModelProperty("用户ID")
    @NotBlank(message = "${comment}不能为空")
    private Long userId;

    @ApiModelProperty("订单编号")
    @Excel(name = "订单编号")
    @NotBlank(message = "订单编号不能为空")
    @Size(min = 0, max = 63, message = "订单编号长度不能超过63个字符")
    private String orderSn;

    @ApiModelProperty("订单状态")
    @Excel(name = "订单状态")
    @NotBlank(message = "订单状态不能为空")
    private Integer orderStatus;

    @ApiModelProperty("售后状态（0可申请 1用户已申请 2管理员审核通过 3管理员退款成功 4管理员审核拒绝 5用户已取消）")
    private Integer aftersaleStatus;

    @ApiModelProperty("收货人名称")
    @Excel(name = "收货人名称")
    @NotBlank(message = "收货人名称不能为空")
    @Size(min = 0, max = 63, message = "收货人名称长度不能超过63个字符")
    private String consignee;

    @ApiModelProperty("收货人手机号")
    @NotBlank(message = "收货人名称不能为空")
    @Size(min = 0, max = 63, message = "收货人名称长度不能超过63个字符")
    private String mobile;

    @ApiModelProperty("收货具体地址")
    @NotBlank(message = "收货人名称不能为空")
    @Size(min = 0, max = 127, message = "收货人名称长度不能超过127个字符")
    private String address;

    @ApiModelProperty("用户订单留言")
    @NotBlank(message = "收货人名称不能为空")
    @Size(min = 0, max = 512, message = "收货人名称长度不能超过512个字符")
    private String message;

    @ApiModelProperty("商品总费用")
    @NotBlank(message = "收货人名称不能为空")
    private BigDecimal goodsPrice;

    @ApiModelProperty("配送费用")
    @NotBlank(message = "收货人名称不能为空")
    private BigDecimal freightPrice;

    @ApiModelProperty("优惠券减免")
    @NotBlank(message = "收货人名称不能为空")
    private BigDecimal couponPrice;

    @ApiModelProperty("用户积分减免")
    @NotBlank(message = "收货人名称不能为空")
    private BigDecimal integralPrice;

    @ApiModelProperty("团购优惠价减免")
    @NotBlank(message = "收货人名称不能为空")
    private BigDecimal grouponPrice;

    @ApiModelProperty("订单费用(goods_price+freight_price-coupon_price)")
    @NotBlank(message = "收货人名称不能为空")
    private BigDecimal orderPrice;

    @ApiModelProperty("实付费用(order_price-integral_price)")
    @Excel(name = "实付费用(order_price-integral_price)")
    @NotBlank(message = "实付费用(order_price-integral_price)不能为空")
    private BigDecimal actualPrice;

    @ApiModelProperty("微信付款编号")
    @Size(min = 0, max = 63, message = "实付费用(order_price-integral_price)长度不能超过63个字符")
    private String payId;

    @ApiModelProperty("微信付款时间")
    @Excel(name = "微信付款时间", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDateTime payTime;

    @ApiModelProperty("发货编号")
    @Size(min = 0, max = 63, message = "微信付款时间长度不能超过63个字符")
    private String shipSn;

    @ApiModelProperty("发货快递公司")
    @Size(min = 0, max = 63, message = "微信付款时间长度不能超过63个字符")
    private String shipChannel;

    @ApiModelProperty("发货开始时间")
    private LocalDateTime shipTime;

    @ApiModelProperty("实际退款金额(有可能退款金额小于实际支付金额)")
    private BigDecimal refundAmount;

    @ApiModelProperty("退款方式")
    @Size(min = 0, max = 63, message = "微信付款时间长度不能超过63个字符")
    private String refundType;

    @ApiModelProperty("退款备注")
    @Size(min = 0, max = 127, message = "微信付款时间长度不能超过127个字符")
    private String refundContent;

    @ApiModelProperty("退款时间")
    private LocalDateTime refundTime;

    @ApiModelProperty("用户确认收货时间")
    private LocalDateTime confirmTime;

    @ApiModelProperty("待评价订单商品数量")
    private Integer comments;

    // @author 严方亚
    @ApiModelProperty("订单关闭时间")
    private LocalDateTime endTime;

    @ApiModelProperty("创建时间")
    private LocalDateTime addTime;

    @ApiModelProperty("逻辑删除")
    private Integer deleted;
}
